import {merchantProductTypes as _merchantProductTypes} from "@/config/dictionary";

/**
 * 获取 实物商品、在线直充、电子卡密...这几种类型的func
 */
export function useGetGoodsType() {
  const productTypes = ref<{label: string, value: string}[]>(_merchantProductTypes)

  const getProductType: (value: string) => string = (value: string) => {
    const targetType = productTypes.value.find(item => item.value === value)
    return targetType?.label ?? value
  }

  return {
    productTypes,
    getProductType
  }
}
